In [1]:
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
In [2]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
In [4]:
data = pd.read_csv('/content/drive/MyDrive/Smart Internz/Datasets/WA_Fn-UseC_-HR-Employee-Attrition.csv')
data.head()
Out[4]:
| Age | Attrition | BusinessTravel | DailyRate | Department | DistanceFromHome | Education | EducationField | EmployeeCount | EmployeeNumber | ... | RelationshipSatisfaction | StandardHours | StockOptionLevel | TotalWorkingYears | TrainingTimesLastYear | WorkLifeBalance | YearsAtCompany | YearsInCurrentRole | YearsSinceLastPromotion | YearsWithCurrManager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 41 | Yes | Travel_Rarely | 1102 | Sales | 1 | 2 | Life Sciences | 1 | 1 | ... | 1 | 80 | 0 | 8 | 0 | 1 | 6 | 4 | 0 | 5 |
| 1 | 49 | No | Travel_Frequently | 279 | Research & Development | 8 | 1 | Life Sciences | 1 | 2 | ... | 4 | 80 | 1 | 10 | 3 | 3 | 10 | 7 | 1 | 7 |
| 2 | 37 | Yes | Travel_Rarely | 1373 | Research & Development | 2 | 2 | Other | 1 | 4 | ... | 2 | 80 | 0 | 7 | 3 | 3 | 0 | 0 | 0 | 0 |
| 3 | 33 | No | Travel_Frequently | 1392 | Research & Development | 3 | 4 | Life Sciences | 1 | 5 | ... | 3 | 80 | 0 | 8 | 3 | 3 | 8 | 7 | 3 | 0 |
| 4 | 27 | No | Travel_Rarely | 591 | Research & Development | 2 | 1 | Medical | 1 | 7 | ... | 4 | 80 | 1 | 6 | 3 | 3 | 2 | 2 | 2 | 2 |
5 rows × 35 columns
In [5]:
data.tail()
Out[5]:
| Age | Attrition | BusinessTravel | DailyRate | Department | DistanceFromHome | Education | EducationField | EmployeeCount | EmployeeNumber | ... | RelationshipSatisfaction | StandardHours | StockOptionLevel | TotalWorkingYears | TrainingTimesLastYear | WorkLifeBalance | YearsAtCompany | YearsInCurrentRole | YearsSinceLastPromotion | YearsWithCurrManager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1465 | 36 | No | Travel_Frequently | 884 | Research & Development | 23 | 2 | Medical | 1 | 2061 | ... | 3 | 80 | 1 | 17 | 3 | 3 | 5 | 2 | 0 | 3 |
| 1466 | 39 | No | Travel_Rarely | 613 | Research & Development | 6 | 1 | Medical | 1 | 2062 | ... | 1 | 80 | 1 | 9 | 5 | 3 | 7 | 7 | 1 | 7 |
| 1467 | 27 | No | Travel_Rarely | 155 | Research & Development | 4 | 3 | Life Sciences | 1 | 2064 | ... | 2 | 80 | 1 | 6 | 0 | 3 | 6 | 2 | 0 | 3 |
| 1468 | 49 | No | Travel_Frequently | 1023 | Sales | 2 | 3 | Medical | 1 | 2065 | ... | 4 | 80 | 0 | 17 | 3 | 2 | 9 | 6 | 0 | 8 |
| 1469 | 34 | No | Travel_Rarely | 628 | Research & Development | 8 | 3 | Medical | 1 | 2068 | ... | 1 | 80 | 0 | 6 | 3 | 4 | 4 | 3 | 1 | 2 |
5 rows × 35 columns
In [6]:
data.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 1470 entries, 0 to 1469 Data columns (total 35 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Age 1470 non-null int64 1 Attrition 1470 non-null object 2 BusinessTravel 1470 non-null object 3 DailyRate 1470 non-null int64 4 Department 1470 non-null object 5 DistanceFromHome 1470 non-null int64 6 Education 1470 non-null int64 7 EducationField 1470 non-null object 8 EmployeeCount 1470 non-null int64 9 EmployeeNumber 1470 non-null int64 10 EnvironmentSatisfaction 1470 non-null int64 11 Gender 1470 non-null object 12 HourlyRate 1470 non-null int64 13 JobInvolvement 1470 non-null int64 14 JobLevel 1470 non-null int64 15 JobRole 1470 non-null object 16 JobSatisfaction 1470 non-null int64 17 MaritalStatus 1470 non-null object 18 MonthlyIncome 1470 non-null int64 19 MonthlyRate 1470 non-null int64 20 NumCompaniesWorked 1470 non-null int64 21 Over18 1470 non-null object 22 OverTime 1470 non-null object 23 PercentSalaryHike 1470 non-null int64 24 PerformanceRating 1470 non-null int64 25 RelationshipSatisfaction 1470 non-null int64 26 StandardHours 1470 non-null int64 27 StockOptionLevel 1470 non-null int64 28 TotalWorkingYears 1470 non-null int64 29 TrainingTimesLastYear 1470 non-null int64 30 WorkLifeBalance 1470 non-null int64 31 YearsAtCompany 1470 non-null int64 32 YearsInCurrentRole 1470 non-null int64 33 YearsSinceLastPromotion 1470 non-null int64 34 YearsWithCurrManager 1470 non-null int64 dtypes: int64(26), object(9) memory usage: 402.1+ KB
In [7]:
data.describe()
Out[7]:
| Age | DailyRate | DistanceFromHome | Education | EmployeeCount | EmployeeNumber | EnvironmentSatisfaction | HourlyRate | JobInvolvement | JobLevel | ... | RelationshipSatisfaction | StandardHours | StockOptionLevel | TotalWorkingYears | TrainingTimesLastYear | WorkLifeBalance | YearsAtCompany | YearsInCurrentRole | YearsSinceLastPromotion | YearsWithCurrManager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.0 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | ... | 1470.000000 | 1470.0 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 | 1470.000000 |
| mean | 36.923810 | 802.485714 | 9.192517 | 2.912925 | 1.0 | 1024.865306 | 2.721769 | 65.891156 | 2.729932 | 2.063946 | ... | 2.712245 | 80.0 | 0.793878 | 11.279592 | 2.799320 | 2.761224 | 7.008163 | 4.229252 | 2.187755 | 4.123129 |
| std | 9.135373 | 403.509100 | 8.106864 | 1.024165 | 0.0 | 602.024335 | 1.093082 | 20.329428 | 0.711561 | 1.106940 | ... | 1.081209 | 0.0 | 0.852077 | 7.780782 | 1.289271 | 0.706476 | 6.126525 | 3.623137 | 3.222430 | 3.568136 |
| min | 18.000000 | 102.000000 | 1.000000 | 1.000000 | 1.0 | 1.000000 | 1.000000 | 30.000000 | 1.000000 | 1.000000 | ... | 1.000000 | 80.0 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 25% | 30.000000 | 465.000000 | 2.000000 | 2.000000 | 1.0 | 491.250000 | 2.000000 | 48.000000 | 2.000000 | 1.000000 | ... | 2.000000 | 80.0 | 0.000000 | 6.000000 | 2.000000 | 2.000000 | 3.000000 | 2.000000 | 0.000000 | 2.000000 |
| 50% | 36.000000 | 802.000000 | 7.000000 | 3.000000 | 1.0 | 1020.500000 | 3.000000 | 66.000000 | 3.000000 | 2.000000 | ... | 3.000000 | 80.0 | 1.000000 | 10.000000 | 3.000000 | 3.000000 | 5.000000 | 3.000000 | 1.000000 | 3.000000 |
| 75% | 43.000000 | 1157.000000 | 14.000000 | 4.000000 | 1.0 | 1555.750000 | 4.000000 | 83.750000 | 3.000000 | 3.000000 | ... | 4.000000 | 80.0 | 1.000000 | 15.000000 | 3.000000 | 3.000000 | 9.000000 | 7.000000 | 3.000000 | 7.000000 |
| max | 60.000000 | 1499.000000 | 29.000000 | 5.000000 | 1.0 | 2068.000000 | 4.000000 | 100.000000 | 4.000000 | 5.000000 | ... | 4.000000 | 80.0 | 3.000000 | 40.000000 | 6.000000 | 4.000000 | 40.000000 | 18.000000 | 15.000000 | 17.000000 |
8 rows × 26 columns
In [8]:
data.isnull().sum()
Out[8]:
Age 0 Attrition 0 BusinessTravel 0 DailyRate 0 Department 0 DistanceFromHome 0 Education 0 EducationField 0 EmployeeCount 0 EmployeeNumber 0 EnvironmentSatisfaction 0 Gender 0 HourlyRate 0 JobInvolvement 0 JobLevel 0 JobRole 0 JobSatisfaction 0 MaritalStatus 0 MonthlyIncome 0 MonthlyRate 0 NumCompaniesWorked 0 Over18 0 OverTime 0 PercentSalaryHike 0 PerformanceRating 0 RelationshipSatisfaction 0 StandardHours 0 StockOptionLevel 0 TotalWorkingYears 0 TrainingTimesLastYear 0 WorkLifeBalance 0 YearsAtCompany 0 YearsInCurrentRole 0 YearsSinceLastPromotion 0 YearsWithCurrManager 0 dtype: int64
In [9]:
cor = data.corr()
<ipython-input-9-06847dd9a2e1>:1: FutureWarning: The default value of numeric_only in DataFrame.corr is deprecated. In a future version, it will default to False. Select only valid columns or specify the value of numeric_only to silence this warning. cor = data.corr()
In [10]:
fig, ax = plt.subplots(figsize=(25,25))
sns.heatmap(cor, annot=True)
Out[10]:
<Axes: >
In [11]:
sns.pairplot(data)
Out[11]:
<seaborn.axisgrid.PairGrid at 0x7d920117f940>
In [12]:
from sklearn.preprocessing import LabelEncoder
In [13]:
le=LabelEncoder()
In [14]:
data["BusinessTravel"]=le.fit_transform(data["BusinessTravel"])
In [15]:
data["Department"]=le.fit_transform(data["Department"])
In [16]:
data["EducationField"]=le.fit_transform(data["EducationField"])
In [17]:
data["Gender"]=le.fit_transform(data["Gender"])
In [18]:
data["JobRole"]=le.fit_transform(data["JobRole"])
In [19]:
data["MaritalStatus"]=le.fit_transform(data["MaritalStatus"])
In [20]:
data["Over18"]=le.fit_transform(data["Over18"])
In [21]:
data["OverTime"]=le.fit_transform(data["OverTime"])
In [22]:
data.head()
Out[22]:
| Age | Attrition | BusinessTravel | DailyRate | Department | DistanceFromHome | Education | EducationField | EmployeeCount | EmployeeNumber | ... | RelationshipSatisfaction | StandardHours | StockOptionLevel | TotalWorkingYears | TrainingTimesLastYear | WorkLifeBalance | YearsAtCompany | YearsInCurrentRole | YearsSinceLastPromotion | YearsWithCurrManager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 41 | Yes | 2 | 1102 | 2 | 1 | 2 | 1 | 1 | 1 | ... | 1 | 80 | 0 | 8 | 0 | 1 | 6 | 4 | 0 | 5 |
| 1 | 49 | No | 1 | 279 | 1 | 8 | 1 | 1 | 1 | 2 | ... | 4 | 80 | 1 | 10 | 3 | 3 | 10 | 7 | 1 | 7 |
| 2 | 37 | Yes | 2 | 1373 | 1 | 2 | 2 | 4 | 1 | 4 | ... | 2 | 80 | 0 | 7 | 3 | 3 | 0 | 0 | 0 | 0 |
| 3 | 33 | No | 1 | 1392 | 1 | 3 | 4 | 1 | 1 | 5 | ... | 3 | 80 | 0 | 8 | 3 | 3 | 8 | 7 | 3 | 0 |
| 4 | 27 | No | 2 | 591 | 1 | 2 | 1 | 3 | 1 | 7 | ... | 4 | 80 | 1 | 6 | 3 | 3 | 2 | 2 | 2 | 2 |
5 rows × 35 columns
In [23]:
data.tail()
Out[23]:
| Age | Attrition | BusinessTravel | DailyRate | Department | DistanceFromHome | Education | EducationField | EmployeeCount | EmployeeNumber | ... | RelationshipSatisfaction | StandardHours | StockOptionLevel | TotalWorkingYears | TrainingTimesLastYear | WorkLifeBalance | YearsAtCompany | YearsInCurrentRole | YearsSinceLastPromotion | YearsWithCurrManager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1465 | 36 | No | 1 | 884 | 1 | 23 | 2 | 3 | 1 | 2061 | ... | 3 | 80 | 1 | 17 | 3 | 3 | 5 | 2 | 0 | 3 |
| 1466 | 39 | No | 2 | 613 | 1 | 6 | 1 | 3 | 1 | 2062 | ... | 1 | 80 | 1 | 9 | 5 | 3 | 7 | 7 | 1 | 7 |
| 1467 | 27 | No | 2 | 155 | 1 | 4 | 3 | 1 | 1 | 2064 | ... | 2 | 80 | 1 | 6 | 0 | 3 | 6 | 2 | 0 | 3 |
| 1468 | 49 | No | 1 | 1023 | 2 | 2 | 3 | 3 | 1 | 2065 | ... | 4 | 80 | 0 | 17 | 3 | 2 | 9 | 6 | 0 | 8 |
| 1469 | 34 | No | 2 | 628 | 1 | 8 | 3 | 3 | 1 | 2068 | ... | 1 | 80 | 0 | 6 | 3 | 4 | 4 | 3 | 1 | 2 |
5 rows × 35 columns
In [24]:
X=data.drop(columns=["EmployeeNumber","EmployeeCount","StandardHours","Attrition","Over18"],axis=1)
In [25]:
y=data["Attrition"]
In [26]:
from sklearn.preprocessing import MinMaxScaler
ms=MinMaxScaler()
In [27]:
X_Scaled=ms.fit_transform(X)
In [28]:
cor=data.corr()
<ipython-input-28-410fe4458127>:1: FutureWarning: The default value of numeric_only in DataFrame.corr is deprecated. In a future version, it will default to False. Select only valid columns or specify the value of numeric_only to silence this warning. cor=data.corr()
In [29]:
fig, ax = plt.subplots(figsize=(30,30))
sns.heatmap(cor, annot=True)
Out[29]:
<Axes: >
In [30]:
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test = train_test_split(X_Scaled,y,test_size =0.2,random_state =0)
In [31]:
from sklearn.linear_model import LogisticRegression
classifier = LogisticRegression(random_state=0)
classifier.fit(x_train,y_train)
Out[31]:
LogisticRegression(random_state=0)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
LogisticRegression(random_state=0)
In [32]:
from sklearn.metrics import accuracy_score,confusion_matrix
y_pred = classifier.predict(x_test)
cm = confusion_matrix(y_test, y_pred)
print(cm)
accuracy_score(y_test, y_pred)*100
[[242 3] [ 32 17]]
Out[32]:
88.09523809523809
In [33]:
from sklearn.metrics import accuracy_score,confusion_matrix,classification_report,roc_auc_score,roc_curve
In [34]:
print(classification_report(y_test,y_pred))
precision recall f1-score support
No 0.88 0.99 0.93 245
Yes 0.85 0.35 0.49 49
accuracy 0.88 294
macro avg 0.87 0.67 0.71 294
weighted avg 0.88 0.88 0.86 294
In [35]:
from sklearn.tree import DecisionTreeClassifier
dtc=DecisionTreeClassifier()
In [36]:
dtc.fit(x_train,y_train)
Out[36]:
DecisionTreeClassifier()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
DecisionTreeClassifier()
In [37]:
from sklearn.metrics import accuracy_score,confusion_matrix
y_pred = dtc.predict(x_test)
cm = confusion_matrix(y_test, y_pred)
print(cm)
accuracy_score(y_test, y_pred)*100
[[200 45] [ 32 17]]
Out[37]:
73.80952380952381
In [38]:
from sklearn import tree
plt.figure(figsize=(25,15))
tree.plot_tree(dtc,filled=True)
Out[38]:
[Text(0.3231385651125402, 0.9722222222222222, 'x[23] <= 0.038\ngini = 0.269\nsamples = 1176\nvalue = [988, 188]'), Text(0.07717041800643087, 0.9166666666666666, 'x[14] <= 0.75\ngini = 0.5\nsamples = 78\nvalue = [39, 39]'), Text(0.04823151125401929, 0.8611111111111112, 'x[4] <= 0.554\ngini = 0.426\nsamples = 39\nvalue = [27, 12]'), Text(0.03215434083601286, 0.8055555555555556, 'x[13] <= 0.167\ngini = 0.312\nsamples = 31\nvalue = [25, 6]'), Text(0.01929260450160772, 0.75, 'x[14] <= 0.25\ngini = 0.49\nsamples = 7\nvalue = [3, 4]'), Text(0.012861736334405145, 0.6944444444444444, 'x[2] <= 0.175\ngini = 0.375\nsamples = 4\nvalue = [3, 1]'), Text(0.006430868167202572, 0.6388888888888888, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.01929260450160772, 0.6388888888888888, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.02572347266881029, 0.6944444444444444, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.04501607717041801, 0.75, 'x[17] <= 0.056\ngini = 0.153\nsamples = 24\nvalue = [22, 2]'), Text(0.03858520900321544, 0.6944444444444444, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.05144694533762058, 0.6944444444444444, 'x[7] <= 0.167\ngini = 0.083\nsamples = 23\nvalue = [22, 1]'), Text(0.04501607717041801, 0.6388888888888888, 'x[2] <= 0.458\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.03858520900321544, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.05144694533762058, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.05787781350482315, 0.6388888888888888, 'gini = 0.0\nsamples = 21\nvalue = [21, 0]'), Text(0.06430868167202572, 0.8055555555555556, 'x[19] <= 0.679\ngini = 0.375\nsamples = 8\nvalue = [2, 6]'), Text(0.05787781350482315, 0.75, 'gini = 0.0\nsamples = 6\nvalue = [0, 6]'), Text(0.0707395498392283, 0.75, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.10610932475884244, 0.8611111111111112, 'x[9] <= 0.364\ngini = 0.426\nsamples = 39\nvalue = [12, 27]'), Text(0.09003215434083602, 0.8055555555555556, 'x[0] <= 0.369\ngini = 0.133\nsamples = 14\nvalue = [1, 13]'), Text(0.08360128617363344, 0.75, 'gini = 0.0\nsamples = 13\nvalue = [0, 13]'), Text(0.09646302250803858, 0.75, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.12218649517684887, 0.8055555555555556, 'x[18] <= 0.5\ngini = 0.493\nsamples = 25\nvalue = [11, 14]'), Text(0.10932475884244373, 0.75, 'x[6] <= 0.7\ngini = 0.484\nsamples = 17\nvalue = [10, 7]'), Text(0.10289389067524116, 0.6944444444444444, 'x[24] <= 0.167\ngini = 0.408\nsamples = 14\nvalue = [10, 4]'), Text(0.09646302250803858, 0.6388888888888888, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.10932475884244373, 0.6388888888888888, 'x[16] <= 0.892\ngini = 0.278\nsamples = 12\nvalue = [10, 2]'), Text(0.10289389067524116, 0.5833333333333334, 'x[25] <= 0.5\ngini = 0.165\nsamples = 11\nvalue = [10, 1]'), Text(0.09646302250803858, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.10932475884244373, 0.5277777777777778, 'gini = 0.0\nsamples = 10\nvalue = [10, 0]'), Text(0.1157556270096463, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.1157556270096463, 0.6944444444444444, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.13504823151125403, 0.75, 'x[2] <= 0.162\ngini = 0.219\nsamples = 8\nvalue = [1, 7]'), Text(0.12861736334405144, 0.6944444444444444, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.1414790996784566, 0.6944444444444444, 'gini = 0.0\nsamples = 7\nvalue = [0, 7]'), Text(0.5691067122186495, 0.9166666666666666, 'x[18] <= 0.5\ngini = 0.235\nsamples = 1098\nvalue = [949, 149]'), Text(0.31626808681672025, 0.8611111111111112, 'x[25] <= 0.167\ngini = 0.162\nsamples = 798\nvalue = [727, 71]'), Text(0.1832797427652733, 0.8055555555555556, 'x[2] <= 0.747\ngini = 0.38\nsamples = 47\nvalue = [35, 12]'), Text(0.17684887459807075, 0.75, 'x[10] <= 0.5\ngini = 0.463\nsamples = 33\nvalue = [21, 12]'), Text(0.15434083601286175, 0.6944444444444444, 'x[4] <= 0.446\ngini = 0.42\nsamples = 10\nvalue = [3, 7]'), Text(0.14790996784565916, 0.6388888888888888, 'gini = 0.0\nsamples = 6\nvalue = [0, 6]'), Text(0.1607717041800643, 0.6388888888888888, 'x[4] <= 0.714\ngini = 0.375\nsamples = 4\nvalue = [3, 1]'), Text(0.15434083601286175, 0.5833333333333334, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.16720257234726688, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.19935691318327975, 0.6944444444444444, 'x[24] <= 0.583\ngini = 0.34\nsamples = 23\nvalue = [18, 5]'), Text(0.1864951768488746, 0.6388888888888888, 'x[9] <= 0.107\ngini = 0.117\nsamples = 16\nvalue = [15, 1]'), Text(0.18006430868167203, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.19292604501607716, 0.5833333333333334, 'gini = 0.0\nsamples = 15\nvalue = [15, 0]'), Text(0.21221864951768488, 0.6388888888888888, 'x[29] <= 0.529\ngini = 0.49\nsamples = 7\nvalue = [3, 4]'), Text(0.2057877813504823, 0.5833333333333334, 'gini = 0.0\nsamples = 4\nvalue = [0, 4]'), Text(0.21864951768488747, 0.5833333333333334, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.18971061093247588, 0.75, 'gini = 0.0\nsamples = 14\nvalue = [14, 0]'), Text(0.4492564308681672, 0.8055555555555556, 'x[26] <= 0.963\ngini = 0.145\nsamples = 751\nvalue = [692, 59]'), Text(0.4428255627009646, 0.75, 'x[26] <= 0.113\ngini = 0.143\nsamples = 750\nvalue = [692, 58]'), Text(0.31189710610932475, 0.6944444444444444, 'x[7] <= 0.167\ngini = 0.218\nsamples = 257\nvalue = [225, 32]'), Text(0.25884244372990356, 0.6388888888888888, 'x[29] <= 0.147\ngini = 0.355\nsamples = 65\nvalue = [50, 15]'), Text(0.2315112540192926, 0.5833333333333334, 'x[29] <= 0.029\ngini = 0.303\nsamples = 59\nvalue = [48, 11]'), Text(0.2090032154340836, 0.5277777777777778, 'x[10] <= 0.5\ngini = 0.463\nsamples = 22\nvalue = [14, 8]'), Text(0.19614147909967847, 0.4722222222222222, 'x[9] <= 0.179\ngini = 0.198\nsamples = 9\nvalue = [8, 1]'), Text(0.18971061093247588, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.20257234726688103, 0.4166666666666667, 'gini = 0.0\nsamples = 8\nvalue = [8, 0]'), Text(0.22186495176848875, 0.4722222222222222, 'x[9] <= 0.4\ngini = 0.497\nsamples = 13\nvalue = [6, 7]'), Text(0.21543408360128619, 0.4166666666666667, 'gini = 0.0\nsamples = 4\nvalue = [4, 0]'), Text(0.2282958199356913, 0.4166666666666667, 'x[4] <= 0.286\ngini = 0.346\nsamples = 9\nvalue = [2, 7]'), Text(0.22186495176848875, 0.3611111111111111, 'x[0] <= 0.226\ngini = 0.444\nsamples = 3\nvalue = [2, 1]'), Text(0.21543408360128619, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.2282958199356913, 0.3055555555555556, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.2347266881028939, 0.3611111111111111, 'gini = 0.0\nsamples = 6\nvalue = [0, 6]'), Text(0.2540192926045016, 0.5277777777777778, 'x[13] <= 0.167\ngini = 0.149\nsamples = 37\nvalue = [34, 3]'), Text(0.24758842443729903, 0.4722222222222222, 'x[25] <= 0.5\ngini = 0.5\nsamples = 6\nvalue = [3, 3]'), Text(0.24115755627009647, 0.4166666666666667, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.2540192926045016, 0.4166666666666667, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.2604501607717042, 0.4722222222222222, 'gini = 0.0\nsamples = 31\nvalue = [31, 0]'), Text(0.2861736334405145, 0.5833333333333334, 'x[25] <= 0.5\ngini = 0.444\nsamples = 6\nvalue = [2, 4]'), Text(0.2797427652733119, 0.5277777777777778, 'x[21] <= 0.667\ngini = 0.444\nsamples = 3\nvalue = [2, 1]'), Text(0.2733118971061093, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.2861736334405145, 0.4722222222222222, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.29260450160771706, 0.5277777777777778, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.364951768488746, 0.6388888888888888, 'x[0] <= 0.321\ngini = 0.161\nsamples = 192\nvalue = [175, 17]'), Text(0.31189710610932475, 0.5833333333333334, 'x[6] <= 0.1\ngini = 0.294\nsamples = 67\nvalue = [55, 12]'), Text(0.3054662379421222, 0.5277777777777778, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.3183279742765273, 0.5277777777777778, 'x[25] <= 0.5\ngini = 0.26\nsamples = 65\nvalue = [55, 10]'), Text(0.3022508038585209, 0.4722222222222222, 'x[9] <= 0.679\ngini = 0.469\nsamples = 16\nvalue = [10, 6]'), Text(0.2958199356913183, 0.4166666666666667, 'x[4] <= 0.018\ngini = 0.444\nsamples = 9\nvalue = [3, 6]'), Text(0.28938906752411575, 0.3611111111111111, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.3022508038585209, 0.3611111111111111, 'x[1] <= 0.25\ngini = 0.245\nsamples = 7\nvalue = [1, 6]'), Text(0.2958199356913183, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.3086816720257235, 0.3055555555555556, 'gini = 0.0\nsamples = 6\nvalue = [0, 6]'), Text(0.3086816720257235, 0.4166666666666667, 'gini = 0.0\nsamples = 7\nvalue = [7, 0]'), Text(0.33440514469453375, 0.4722222222222222, 'x[2] <= 0.037\ngini = 0.15\nsamples = 49\nvalue = [45, 4]'), Text(0.3279742765273312, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.3408360128617363, 0.4166666666666667, 'x[2] <= 0.938\ngini = 0.117\nsamples = 48\nvalue = [45, 3]'), Text(0.33440514469453375, 0.3611111111111111, 'x[5] <= 0.875\ngini = 0.081\nsamples = 47\nvalue = [45, 2]'), Text(0.3215434083601286, 0.3055555555555556, 'x[10] <= 0.167\ngini = 0.043\nsamples = 45\nvalue = [44, 1]'), Text(0.31511254019292606, 0.25, 'x[7] <= 0.667\ngini = 0.444\nsamples = 3\nvalue = [2, 1]'), Text(0.3086816720257235, 0.19444444444444445, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.3215434083601286, 0.19444444444444445, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.3279742765273312, 0.25, 'gini = 0.0\nsamples = 42\nvalue = [42, 0]'), Text(0.34726688102893893, 0.3055555555555556, 'x[19] <= 0.393\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.3408360128617363, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.3536977491961415, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.34726688102893893, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.4180064308681672, 0.5833333333333334, 'x[6] <= 0.9\ngini = 0.077\nsamples = 125\nvalue = [120, 5]'), Text(0.40514469453376206, 0.5277777777777778, 'x[0] <= 0.393\ngini = 0.05\nsamples = 118\nvalue = [115, 3]'), Text(0.3987138263665595, 0.4722222222222222, 'x[2] <= 0.956\ngini = 0.185\nsamples = 29\nvalue = [26, 3]'), Text(0.39228295819935693, 0.4166666666666667, 'x[29] <= 0.147\ngini = 0.133\nsamples = 28\nvalue = [26, 2]'), Text(0.37942122186495175, 0.3611111111111111, 'x[10] <= 0.167\ngini = 0.074\nsamples = 26\nvalue = [25, 1]'), Text(0.3729903536977492, 0.3055555555555556, 'x[13] <= 0.833\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.3665594855305466, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.37942122186495175, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.3858520900321543, 0.3055555555555556, 'gini = 0.0\nsamples = 24\nvalue = [24, 0]'), Text(0.40514469453376206, 0.3611111111111111, 'x[9] <= 0.55\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.3987138263665595, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.4115755627009646, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.40514469453376206, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.4115755627009646, 0.4722222222222222, 'gini = 0.0\nsamples = 89\nvalue = [89, 0]'), Text(0.43086816720257237, 0.5277777777777778, 'x[15] <= 0.08\ngini = 0.408\nsamples = 7\nvalue = [5, 2]'), Text(0.42443729903536975, 0.4722222222222222, 'x[13] <= 0.333\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.4180064308681672, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.43086816720257237, 0.4166666666666667, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.43729903536977494, 0.4722222222222222, 'gini = 0.0\nsamples = 4\nvalue = [4, 0]'), Text(0.5737540192926045, 0.6944444444444444, 'x[26] <= 0.787\ngini = 0.1\nsamples = 493\nvalue = [467, 26]'), Text(0.5397909967845659, 0.6388888888888888, 'x[13] <= 0.5\ngini = 0.094\nsamples = 486\nvalue = [462, 24]'), Text(0.49115755627009644, 0.5833333333333334, 'x[12] <= 0.938\ngini = 0.154\nsamples = 191\nvalue = [175, 16]'), Text(0.4847266881028939, 0.5277777777777778, 'x[16] <= 0.481\ngini = 0.145\nsamples = 190\nvalue = [175, 15]'), Text(0.4646302250803859, 0.4722222222222222, 'x[16] <= 0.47\ngini = 0.221\nsamples = 95\nvalue = [83, 12]'), Text(0.45819935691318325, 0.4166666666666667, 'x[29] <= 0.794\ngini = 0.207\nsamples = 94\nvalue = [83, 11]'), Text(0.4517684887459807, 0.3611111111111111, 'x[5] <= 0.375\ngini = 0.192\nsamples = 93\nvalue = [83, 10]'), Text(0.42443729903536975, 0.3055555555555556, 'x[6] <= 0.9\ngini = 0.363\nsamples = 21\nvalue = [16, 5]'), Text(0.4180064308681672, 0.25, 'x[15] <= 0.413\ngini = 0.266\nsamples = 19\nvalue = [16, 3]'), Text(0.40514469453376206, 0.19444444444444445, 'x[15] <= 0.141\ngini = 0.117\nsamples = 16\nvalue = [15, 1]'), Text(0.3987138263665595, 0.1388888888888889, 'x[4] <= 0.679\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.39228295819935693, 0.08333333333333333, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.40514469453376206, 0.08333333333333333, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.4115755627009646, 0.1388888888888889, 'gini = 0.0\nsamples = 14\nvalue = [14, 0]'), Text(0.43086816720257237, 0.19444444444444445, 'x[17] <= 0.278\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.42443729903536975, 0.1388888888888889, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.43729903536977494, 0.1388888888888889, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.43086816720257237, 0.25, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.4790996784565916, 0.3055555555555556, 'x[27] <= 0.139\ngini = 0.129\nsamples = 72\nvalue = [67, 5]'), Text(0.4630225080385852, 0.25, 'x[15] <= 0.244\ngini = 0.444\nsamples = 6\nvalue = [4, 2]'), Text(0.4565916398713826, 0.19444444444444445, 'x[16] <= 0.12\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.45016077170418006, 0.1388888888888889, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.4630225080385852, 0.1388888888888889, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.4694533762057878, 0.19444444444444445, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.49517684887459806, 0.25, 'x[2] <= 0.958\ngini = 0.087\nsamples = 66\nvalue = [63, 3]'), Text(0.48231511254019294, 0.19444444444444445, 'x[24] <= 0.583\ngini = 0.061\nsamples = 64\nvalue = [62, 2]'), Text(0.4758842443729904, 0.1388888888888889, 'gini = 0.0\nsamples = 52\nvalue = [52, 0]'), Text(0.4887459807073955, 0.1388888888888889, 'x[12] <= 0.812\ngini = 0.278\nsamples = 12\nvalue = [10, 2]'), Text(0.48231511254019294, 0.08333333333333333, 'gini = 0.0\nsamples = 9\nvalue = [9, 0]'), Text(0.49517684887459806, 0.08333333333333333, 'x[27] <= 0.306\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.4887459807073955, 0.027777777777777776, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.5016077170418006, 0.027777777777777776, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.5080385852090032, 0.19444444444444445, 'x[3] <= 0.75\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.5016077170418006, 0.1388888888888889, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5144694533762058, 0.1388888888888889, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.4646302250803859, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.47106109324758844, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5048231511254019, 0.4722222222222222, 'x[17] <= 0.5\ngini = 0.061\nsamples = 95\nvalue = [92, 3]'), Text(0.4983922829581994, 0.4166666666666667, 'gini = 0.0\nsamples = 76\nvalue = [76, 0]'), Text(0.5112540192926045, 0.4166666666666667, 'x[29] <= 0.088\ngini = 0.266\nsamples = 19\nvalue = [16, 3]'), Text(0.4983922829581994, 0.3611111111111111, 'x[4] <= 0.268\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.4919614147909968, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.5048231511254019, 0.3055555555555556, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.5241157556270096, 0.3611111111111111, 'x[15] <= 0.108\ngini = 0.117\nsamples = 16\nvalue = [15, 1]'), Text(0.5176848874598071, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5305466237942122, 0.3055555555555556, 'gini = 0.0\nsamples = 15\nvalue = [15, 0]'), Text(0.49758842443729906, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5884244372990354, 0.5833333333333334, 'x[19] <= 0.036\ngini = 0.053\nsamples = 295\nvalue = [287, 8]'), Text(0.5659163987138264, 0.5277777777777778, 'x[28] <= 0.7\ngini = 0.159\nsamples = 46\nvalue = [42, 4]'), Text(0.5594855305466238, 0.4722222222222222, 'x[9] <= 0.071\ngini = 0.124\nsamples = 45\nvalue = [42, 3]'), Text(0.5434083601286174, 0.4166666666666667, 'x[17] <= 0.056\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.5369774919614148, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.5498392282958199, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5755627009646302, 0.4166666666666667, 'x[23] <= 0.688\ngini = 0.089\nsamples = 43\nvalue = [41, 2]'), Text(0.5627009646302251, 0.3611111111111111, 'x[12] <= 0.062\ngini = 0.048\nsamples = 41\nvalue = [40, 1]'), Text(0.5562700964630225, 0.3055555555555556, 'x[26] <= 0.237\ngini = 0.375\nsamples = 4\nvalue = [3, 1]'), Text(0.5498392282958199, 0.25, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.5627009646302251, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.5691318327974276, 0.3055555555555556, 'gini = 0.0\nsamples = 37\nvalue = [37, 0]'), Text(0.5884244372990354, 0.3611111111111111, 'x[29] <= 0.118\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.5819935691318328, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.594855305466238, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.572347266881029, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.6109324758842444, 0.5277777777777778, 'x[15] <= 0.056\ngini = 0.032\nsamples = 249\nvalue = [245, 4]'), Text(0.594855305466238, 0.4722222222222222, 'x[8] <= 0.5\ngini = 0.32\nsamples = 5\nvalue = [4, 1]'), Text(0.5884244372990354, 0.4166666666666667, 'gini = 0.0\nsamples = 4\nvalue = [4, 0]'), Text(0.6012861736334405, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.6270096463022508, 0.4722222222222222, 'x[2] <= 0.015\ngini = 0.024\nsamples = 244\nvalue = [241, 3]'), Text(0.6141479099678456, 0.4166666666666667, 'x[16] <= 0.715\ngini = 0.278\nsamples = 6\nvalue = [5, 1]'), Text(0.6077170418006431, 0.3611111111111111, 'gini = 0.0\nsamples = 5\nvalue = [5, 0]'), Text(0.6205787781350482, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.639871382636656, 0.4166666666666667, 'x[21] <= 0.167\ngini = 0.017\nsamples = 238\nvalue = [236, 2]'), Text(0.6334405144694534, 0.3611111111111111, 'x[25] <= 0.833\ngini = 0.073\nsamples = 53\nvalue = [51, 2]'), Text(0.6205787781350482, 0.3055555555555556, 'x[29] <= 0.088\ngini = 0.041\nsamples = 48\nvalue = [47, 1]'), Text(0.6141479099678456, 0.25, 'x[0] <= 0.345\ngini = 0.245\nsamples = 7\nvalue = [6, 1]'), Text(0.6077170418006431, 0.19444444444444445, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.6205787781350482, 0.19444444444444445, 'gini = 0.0\nsamples = 6\nvalue = [6, 0]'), Text(0.6270096463022508, 0.25, 'gini = 0.0\nsamples = 41\nvalue = [41, 0]'), Text(0.6463022508038585, 0.3055555555555556, 'x[19] <= 0.357\ngini = 0.32\nsamples = 5\nvalue = [4, 1]'), Text(0.639871382636656, 0.25, 'gini = 0.0\nsamples = 4\nvalue = [4, 0]'), Text(0.6527331189710611, 0.25, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.6463022508038585, 0.3611111111111111, 'gini = 0.0\nsamples = 185\nvalue = [185, 0]'), Text(0.6077170418006431, 0.6388888888888888, 'x[2] <= 0.366\ngini = 0.408\nsamples = 7\nvalue = [5, 2]'), Text(0.6012861736334405, 0.5833333333333334, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.6141479099678456, 0.5833333333333334, 'gini = 0.0\nsamples = 5\nvalue = [5, 0]'), Text(0.45568729903536975, 0.75, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.8219453376205788, 0.8611111111111112, 'x[15] <= 0.157\ngini = 0.385\nsamples = 300\nvalue = [222, 78]'), Text(0.7355305466237942, 0.8055555555555556, 'x[22] <= 0.167\ngini = 0.5\nsamples = 96\nvalue = [49, 47]'), Text(0.7041800643086816, 0.75, 'x[4] <= 0.161\ngini = 0.459\nsamples = 42\nvalue = [15, 27]'), Text(0.684887459807074, 0.6944444444444444, 'x[16] <= 0.41\ngini = 0.499\nsamples = 23\nvalue = [12, 11]'), Text(0.6655948553054662, 0.6388888888888888, 'x[15] <= 0.061\ngini = 0.426\nsamples = 13\nvalue = [4, 9]'), Text(0.6591639871382636, 0.5833333333333334, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.6720257234726688, 0.5833333333333334, 'x[9] <= 0.993\ngini = 0.298\nsamples = 11\nvalue = [2, 9]'), Text(0.6655948553054662, 0.5277777777777778, 'x[0] <= 0.214\ngini = 0.18\nsamples = 10\nvalue = [1, 9]'), Text(0.6591639871382636, 0.4722222222222222, 'x[0] <= 0.131\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.6527331189710611, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.6655948553054662, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.6720257234726688, 0.4722222222222222, 'gini = 0.0\nsamples = 8\nvalue = [0, 8]'), Text(0.6784565916398714, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7041800643086816, 0.6388888888888888, 'x[7] <= 0.167\ngini = 0.32\nsamples = 10\nvalue = [8, 2]'), Text(0.6977491961414791, 0.5833333333333334, 'x[24] <= 0.5\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.6913183279742765, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7041800643086816, 0.5277777777777778, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.7106109324758842, 0.5833333333333334, 'gini = 0.0\nsamples = 7\nvalue = [7, 0]'), Text(0.7234726688102894, 0.6944444444444444, 'x[9] <= 0.2\ngini = 0.266\nsamples = 19\nvalue = [3, 16]'), Text(0.7170418006430869, 0.6388888888888888, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.729903536977492, 0.6388888888888888, 'x[11] <= 0.125\ngini = 0.198\nsamples = 18\nvalue = [2, 16]'), Text(0.7234726688102894, 0.5833333333333334, 'x[0] <= 0.595\ngini = 0.111\nsamples = 17\nvalue = [1, 16]'), Text(0.7170418006430869, 0.5277777777777778, 'gini = 0.0\nsamples = 15\nvalue = [0, 15]'), Text(0.729903536977492, 0.5277777777777778, 'x[24] <= 0.333\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.7234726688102894, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7363344051446945, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.7363344051446945, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7668810289389068, 0.75, 'x[0] <= 0.202\ngini = 0.466\nsamples = 54\nvalue = [34, 20]'), Text(0.7491961414790996, 0.6944444444444444, 'x[0] <= 0.107\ngini = 0.245\nsamples = 7\nvalue = [1, 6]'), Text(0.7427652733118971, 0.6388888888888888, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7556270096463023, 0.6388888888888888, 'gini = 0.0\nsamples = 6\nvalue = [0, 6]'), Text(0.7845659163987139, 0.6944444444444444, 'x[2] <= 0.622\ngini = 0.418\nsamples = 47\nvalue = [33, 14]'), Text(0.7684887459807074, 0.6388888888888888, 'x[2] <= 0.145\ngini = 0.482\nsamples = 32\nvalue = [19, 13]'), Text(0.7556270096463023, 0.5833333333333334, 'x[26] <= 0.237\ngini = 0.18\nsamples = 10\nvalue = [9, 1]'), Text(0.7491961414790996, 0.5277777777777778, 'gini = 0.0\nsamples = 9\nvalue = [9, 0]'), Text(0.7620578778135049, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.7813504823151125, 0.5833333333333334, 'x[16] <= 0.87\ngini = 0.496\nsamples = 22\nvalue = [10, 12]'), Text(0.77491961414791, 0.5277777777777778, 'x[25] <= 0.833\ngini = 0.465\nsamples = 19\nvalue = [7, 12]'), Text(0.7684887459807074, 0.4722222222222222, 'x[17] <= 0.167\ngini = 0.415\nsamples = 17\nvalue = [5, 12]'), Text(0.7556270096463023, 0.4166666666666667, 'x[19] <= 0.321\ngini = 0.49\nsamples = 7\nvalue = [4, 3]'), Text(0.7491961414790996, 0.3611111111111111, 'gini = 0.0\nsamples = 4\nvalue = [4, 0]'), Text(0.7620578778135049, 0.3611111111111111, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.7813504823151125, 0.4166666666666667, 'x[21] <= 0.333\ngini = 0.18\nsamples = 10\nvalue = [1, 9]'), Text(0.77491961414791, 0.3611111111111111, 'x[17] <= 0.389\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.7684887459807074, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.7813504823151125, 0.3055555555555556, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.7877813504823151, 0.3611111111111111, 'gini = 0.0\nsamples = 8\nvalue = [0, 8]'), Text(0.7813504823151125, 0.4722222222222222, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.7877813504823151, 0.5277777777777778, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.8006430868167203, 0.6388888888888888, 'x[9] <= 0.064\ngini = 0.124\nsamples = 15\nvalue = [14, 1]'), Text(0.7942122186495176, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.8070739549839229, 0.5833333333333334, 'gini = 0.0\nsamples = 14\nvalue = [14, 0]'), Text(0.9083601286173634, 0.8055555555555556, 'x[14] <= 0.75\ngini = 0.258\nsamples = 204\nvalue = [173, 31]'), Text(0.8520900321543409, 0.75, 'x[15] <= 0.992\ngini = 0.138\nsamples = 147\nvalue = [136, 11]'), Text(0.8456591639871383, 0.6944444444444444, 'x[4] <= 0.482\ngini = 0.128\nsamples = 146\nvalue = [136, 10]'), Text(0.8263665594855305, 0.6388888888888888, 'x[26] <= 0.063\ngini = 0.038\nsamples = 104\nvalue = [102, 2]'), Text(0.819935691318328, 0.5833333333333334, 'x[9] <= 0.193\ngini = 0.32\nsamples = 10\nvalue = [8, 2]'), Text(0.8135048231511254, 0.5277777777777778, 'x[12] <= 0.562\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.8070739549839229, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.819935691318328, 0.4722222222222222, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.8263665594855305, 0.5277777777777778, 'gini = 0.0\nsamples = 7\nvalue = [7, 0]'), Text(0.8327974276527331, 0.5833333333333334, 'gini = 0.0\nsamples = 94\nvalue = [94, 0]'), Text(0.864951768488746, 0.6388888888888888, 'x[7] <= 0.167\ngini = 0.308\nsamples = 42\nvalue = [34, 8]'), Text(0.8456591639871383, 0.5833333333333334, 'x[9] <= 0.307\ngini = 0.375\nsamples = 4\nvalue = [1, 3]'), Text(0.8392282958199357, 0.5277777777777778, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.8520900321543409, 0.5277777777777778, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.8842443729903537, 0.5833333333333334, 'x[0] <= 0.393\ngini = 0.229\nsamples = 38\nvalue = [33, 5]'), Text(0.864951768488746, 0.5277777777777778, 'x[1] <= 0.25\ngini = 0.5\nsamples = 6\nvalue = [3, 3]'), Text(0.8585209003215434, 0.4722222222222222, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.8713826366559485, 0.4722222222222222, 'x[24] <= 0.417\ngini = 0.375\nsamples = 4\nvalue = [1, 3]'), Text(0.864951768488746, 0.4166666666666667, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.8778135048231511, 0.4166666666666667, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.9035369774919614, 0.5277777777777778, 'x[24] <= 0.917\ngini = 0.117\nsamples = 32\nvalue = [30, 2]'), Text(0.8971061093247589, 0.4722222222222222, 'x[12] <= 0.812\ngini = 0.062\nsamples = 31\nvalue = [30, 1]'), Text(0.8906752411575563, 0.4166666666666667, 'gini = 0.0\nsamples = 28\nvalue = [28, 0]'), Text(0.9035369774919614, 0.4166666666666667, 'x[27] <= 0.25\ngini = 0.444\nsamples = 3\nvalue = [2, 1]'), Text(0.8971061093247589, 0.3611111111111111, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.909967845659164, 0.3611111111111111, 'gini = 0.0\nsamples = 2\nvalue = [2, 0]'), Text(0.909967845659164, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.8585209003215434, 0.6944444444444444, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.9646302250803859, 0.75, 'x[12] <= 0.812\ngini = 0.456\nsamples = 57\nvalue = [37, 20]'), Text(0.9421221864951769, 0.6944444444444444, 'x[28] <= 0.4\ngini = 0.238\nsamples = 29\nvalue = [25, 4]'), Text(0.9292604501607717, 0.6388888888888888, 'x[9] <= 0.964\ngini = 0.142\nsamples = 26\nvalue = [24, 2]'), Text(0.9228295819935691, 0.5833333333333334, 'x[20] <= 0.5\ngini = 0.077\nsamples = 25\nvalue = [24, 1]'), Text(0.9163987138263665, 0.5277777777777778, 'gini = 0.0\nsamples = 23\nvalue = [23, 0]'), Text(0.9292604501607717, 0.5277777777777778, 'x[23] <= 0.263\ngini = 0.5\nsamples = 2\nvalue = [1, 1]'), Text(0.9228295819935691, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.9356913183279743, 0.4722222222222222, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.9356913183279743, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [0, 1]'), Text(0.954983922829582, 0.6388888888888888, 'x[28] <= 0.933\ngini = 0.444\nsamples = 3\nvalue = [1, 2]'), Text(0.9485530546623794, 0.5833333333333334, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.9614147909967846, 0.5833333333333334, 'gini = 0.0\nsamples = 1\nvalue = [1, 0]'), Text(0.9871382636655949, 0.6944444444444444, 'x[28] <= 0.1\ngini = 0.49\nsamples = 28\nvalue = [12, 16]'), Text(0.9807073954983923, 0.6388888888888888, 'x[10] <= 0.833\ngini = 0.48\nsamples = 20\nvalue = [12, 8]'), Text(0.9742765273311897, 0.5833333333333334, 'x[26] <= 0.013\ngini = 0.415\nsamples = 17\nvalue = [12, 5]'), Text(0.9678456591639871, 0.5277777777777778, 'gini = 0.0\nsamples = 2\nvalue = [0, 2]'), Text(0.9807073954983923, 0.5277777777777778, 'x[16] <= 0.505\ngini = 0.32\nsamples = 15\nvalue = [12, 3]'), Text(0.9742765273311897, 0.4722222222222222, 'gini = 0.0\nsamples = 9\nvalue = [9, 0]'), Text(0.9871382636655949, 0.4722222222222222, 'x[16] <= 0.706\ngini = 0.5\nsamples = 6\nvalue = [3, 3]'), Text(0.9807073954983923, 0.4166666666666667, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.9935691318327974, 0.4166666666666667, 'gini = 0.0\nsamples = 3\nvalue = [3, 0]'), Text(0.9871382636655949, 0.5833333333333334, 'gini = 0.0\nsamples = 3\nvalue = [0, 3]'), Text(0.9935691318327974, 0.6388888888888888, 'gini = 0.0\nsamples = 8\nvalue = [0, 8]')]
In [39]:
from sklearn.model_selection import GridSearchCV
parameter={
'criterion':['gini','entropy'],
'splitter':['best','random'],
'max_depth':[1,2,3,4,5,6,7,8,9,10],
'max_features':['auto', 'sqrt', 'log2']
}
In [40]:
grid_search=GridSearchCV(estimator=dtc,param_grid=parameter,cv=5,scoring="accuracy")
In [41]:
grid_search.fit(x_train,y_train)
/usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn( /usr/local/lib/python3.10/dist-packages/sklearn/tree/_classes.py:269: FutureWarning: `max_features='auto'` has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set `max_features='sqrt'`. warnings.warn(
Out[41]:
GridSearchCV(cv=5, estimator=DecisionTreeClassifier(),
param_grid={'criterion': ['gini', 'entropy'],
'max_depth': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'max_features': ['auto', 'sqrt', 'log2'],
'splitter': ['best', 'random']},
scoring='accuracy')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
GridSearchCV(cv=5, estimator=DecisionTreeClassifier(),
param_grid={'criterion': ['gini', 'entropy'],
'max_depth': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'max_features': ['auto', 'sqrt', 'log2'],
'splitter': ['best', 'random']},
scoring='accuracy')DecisionTreeClassifier()
DecisionTreeClassifier()
In [42]:
grid_search.best_params_
Out[42]:
{'criterion': 'entropy',
'max_depth': 4,
'max_features': 'sqrt',
'splitter': 'random'}
In [43]:
dtc_cv=DecisionTreeClassifier(criterion= 'entropy',
max_depth= 4,
max_features= 'sqrt',
splitter= 'best')
dtc_cv.fit(x_train,y_train)
Out[43]:
DecisionTreeClassifier(criterion='entropy', max_depth=4, max_features='sqrt')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
DecisionTreeClassifier(criterion='entropy', max_depth=4, max_features='sqrt')
In [44]:
print(classification_report(y_test,y_pred))
precision recall f1-score support
No 0.86 0.82 0.84 245
Yes 0.27 0.35 0.31 49
accuracy 0.74 294
macro avg 0.57 0.58 0.57 294
weighted avg 0.76 0.74 0.75 294
In [45]:
from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier(n_estimators = 1000, criterion = 'entropy', random_state = 0)
classifier.fit(x_train, y_train)
Out[45]:
RandomForestClassifier(criterion='entropy', n_estimators=1000, random_state=0)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
RandomForestClassifier(criterion='entropy', n_estimators=1000, random_state=0)
In [46]:
from sklearn.metrics import confusion_matrix, accuracy_score
y_pred = classifier.predict(x_test)
cm = confusion_matrix(y_test, y_pred)
print(cm)
accuracy_score(y_test, y_pred)
[[243 2] [ 41 8]]
Out[46]:
0.8537414965986394
In [47]:
from sklearn.ensemble import RandomForestClassifier
In [48]:
rfc=RandomForestClassifier()
In [49]:
forest_params = [{'max_depth': list(range(10, 15)), 'max_features': list(range(0,14))}]
In [50]:
rfc_cv=GridSearchCV(rfc,param_grid=forest_params,cv=10,scoring="accuracy")
In [51]:
rfc_cv.fit(x_train,y_train)
/usr/local/lib/python3.10/dist-packages/sklearn/model_selection/_validation.py:378: FitFailedWarning:
50 fits failed out of a total of 700.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.
Below are more details about the failures:
--------------------------------------------------------------------------------
50 fits failed with the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/sklearn/model_selection/_validation.py", line 686, in _fit_and_score
estimator.fit(X_train, y_train, **fit_params)
File "/usr/local/lib/python3.10/dist-packages/sklearn/ensemble/_forest.py", line 340, in fit
self._validate_params()
File "/usr/local/lib/python3.10/dist-packages/sklearn/base.py", line 600, in _validate_params
validate_parameter_constraints(
File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_param_validation.py", line 97, in validate_parameter_constraints
raise InvalidParameterError(
sklearn.utils._param_validation.InvalidParameterError: The 'max_features' parameter of RandomForestClassifier must be an int in the range [1, inf), a float in the range (0.0, 1.0], a str among {'log2', 'auto' (deprecated), 'sqrt'} or None. Got 0 instead.
warnings.warn(some_fits_failed_message, FitFailedWarning)
/usr/local/lib/python3.10/dist-packages/sklearn/model_selection/_search.py:952: UserWarning: One or more of the test scores are non-finite: [ nan 0.84865276 0.85373751 0.85883674 0.86308851 0.86306678
0.85798204 0.86222657 0.86224105 0.86137187 0.85967695 0.85796031
0.85712009 0.85967695 nan 0.84863103 0.85885122 0.85883674
0.86137911 0.8596842 0.8622483 0.86223381 0.85881501 0.85967695
0.8605389 0.86221932 0.8596842 0.86138635 nan 0.85373026
0.85457772 0.85969144 0.8605389 0.85714907 0.86053165 0.85967695
0.86136462 0.86137911 0.86137187 0.86306678 0.86053165 0.86221208
nan 0.84866 0.85544691 0.85885122 0.86051717 0.86307403
0.85797479 0.85798204 0.85882949 0.86051717 0.85965522 0.85371578
0.86138635 0.85630161 nan 0.84779806 0.85543966 0.85714907
0.86648559 0.86137911 0.86476894 0.85882949 0.86051717 0.85541069
0.86136462 0.86052441 0.85882225 0.85712734]
warnings.warn(
Out[51]:
GridSearchCV(cv=10, estimator=RandomForestClassifier(),
param_grid=[{'max_depth': [10, 11, 12, 13, 14],
'max_features': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13]}],
scoring='accuracy')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
GridSearchCV(cv=10, estimator=RandomForestClassifier(),
param_grid=[{'max_depth': [10, 11, 12, 13, 14],
'max_features': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13]}],
scoring='accuracy')RandomForestClassifier()
RandomForestClassifier()
In [52]:
print(classification_report(y_test,y_pred))
precision recall f1-score support
No 0.86 0.99 0.92 245
Yes 0.80 0.16 0.27 49
accuracy 0.85 294
macro avg 0.83 0.58 0.59 294
weighted avg 0.85 0.85 0.81 294